Optimal. Leaf size=35 \[ -\frac{\cot (c+d x)}{a^2 d}+\frac{2 \tanh ^{-1}(\cos (c+d x))}{a^2 d}+\frac{x}{a^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.148947, antiderivative size = 35, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.172, Rules used = {2869, 2757, 3770, 3767, 8} \[ -\frac{\cot (c+d x)}{a^2 d}+\frac{2 \tanh ^{-1}(\cos (c+d x))}{a^2 d}+\frac{x}{a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2869
Rule 2757
Rule 3770
Rule 3767
Rule 8
Rubi steps
\begin{align*} \int \frac{\cos ^2(c+d x) \cot ^2(c+d x)}{(a+a \sin (c+d x))^2} \, dx &=\frac{\int \csc ^2(c+d x) (a-a \sin (c+d x))^2 \, dx}{a^4}\\ &=\frac{\int \left (a^2-2 a^2 \csc (c+d x)+a^2 \csc ^2(c+d x)\right ) \, dx}{a^4}\\ &=\frac{x}{a^2}+\frac{\int \csc ^2(c+d x) \, dx}{a^2}-\frac{2 \int \csc (c+d x) \, dx}{a^2}\\ &=\frac{x}{a^2}+\frac{2 \tanh ^{-1}(\cos (c+d x))}{a^2 d}-\frac{\operatorname{Subst}(\int 1 \, dx,x,\cot (c+d x))}{a^2 d}\\ &=\frac{x}{a^2}+\frac{2 \tanh ^{-1}(\cos (c+d x))}{a^2 d}-\frac{\cot (c+d x)}{a^2 d}\\ \end{align*}
Mathematica [B] time = 0.356838, size = 98, normalized size = 2.8 \[ \frac{\left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )^4 \left (2 (c+d x)+\tan \left (\frac{1}{2} (c+d x)\right )-\cot \left (\frac{1}{2} (c+d x)\right )-4 \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )+4 \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )\right )}{2 d (a \sin (c+d x)+a)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.138, size = 74, normalized size = 2.1 \begin{align*}{\frac{1}{2\,d{a}^{2}}\tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) }+2\,{\frac{\arctan \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) }{d{a}^{2}}}-{\frac{1}{2\,d{a}^{2}} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{-1}}-2\,{\frac{\ln \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) }{d{a}^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.70309, size = 126, normalized size = 3.6 \begin{align*} \frac{\frac{4 \, \arctan \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} - \frac{4 \, \log \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} - \frac{\cos \left (d x + c\right ) + 1}{a^{2} \sin \left (d x + c\right )} + \frac{\sin \left (d x + c\right )}{a^{2}{\left (\cos \left (d x + c\right ) + 1\right )}}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.15895, size = 193, normalized size = 5.51 \begin{align*} \frac{d x \sin \left (d x + c\right ) + \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) - \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) - \cos \left (d x + c\right )}{a^{2} d \sin \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.37281, size = 99, normalized size = 2.83 \begin{align*} \frac{\frac{2 \,{\left (d x + c\right )}}{a^{2}} - \frac{4 \, \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right )}{a^{2}} + \frac{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{a^{2}} + \frac{4 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1}{a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]